<template>
    <div>
        <el-menu>
            <el-submenu v-for="(item, index) in menuList" :index="'a' + index">
                <template slot="title">
                    <i class="el-icon-location"></i>
                    <span>{{item.name}}</span>
                </template>
                <el-menu-item v-for="(item1, index1) in item.list" :index="'b-' + index + '-' + index1"
                              @click.native="chooseMenu(item1)"
                >{{item1.name}}
                </el-menu-item>
            </el-submenu>
        </el-menu>

    </div>
</template>

<script>

    import {mapGetters} from 'vuex'

    export default {

        name: 'menu1',

        data() {
            return {}
        },

        props: {},

        components: {},

        computed: {
            ...mapGetters([
                'menuList',
            ]),
        },

        methods: {
            async init() {

            },

            chooseMenu(item) {
                console.log(item)
                this.$router.push({
                    name: item.href,
                });
            },
        },

        watch: {},

        mounted() {
            this.init();
        },

    }
</script>

<style scoped>

</style>
